﻿@namespace CodeManDesktopBlazor.BlazorComponents.Pages

@page "/classGenTable"

<Table TItem="ClassGenDTOCreateUpdate" ShowLineNo="true" LineNoText="序号" IsPagination="true" PageItemsSource="@PageItemsSource" Height="@tableHeight"
       IsStriped="true" IsBordered="true" ShowSkeleton="true" IsMultipleSelect="true" ShowLoading="true"
       ShowToolbar="true" ShowSearch="true" ShowExtendButtons="true" DataService="DataService"
       UseInjectDataService="true" AutoGenerateColumns="true" ShowDetailRow="ShowDetailRow"
       OnClickDetailRowCallback="OnClickDetailRowCallback">
    <TableToolbarTemplate>
        <TableToolbarButton TItem="ClassGenDTOCreateUpdate" Color="Color.Success" Icon="fa fa-fw fa-free-code-camp" Text="代码生成" IsAsync OnClickCallback="@DownloadAsync" />
    </TableToolbarTemplate>
    <TableColumns>
        <TableColumn @bind-Field="@context.Name" Width="120" />
        <TableColumn @bind-Field="@context.Desc" Width="120" />
        <TableColumn @bind-Field="@context.Namespace" />
        <TableColumn @bind-Field="@context.Type" Width="20" />
    </TableColumns>
    <DetailRowTemplate>
        <div style="min-width:@(Width)px;">
            <Table TItem="ClassAttributeDTO" ShowLineNo="true" LineNoText="序号" IsBordered="true" IsMultipleSelect="true" ShowLoading="true" AllowResizing="true" IsStriped="true" Height="500" IsPagination="true" PageItemsSource="@PageItemsSource"
                   ShowToolbar="true" ShowExtendButtons="true" AutoGenerateColumns="true"
                   UseInjectDataService="true" UseInjectDataDetailsService="true" ParentKeyId="@context.Id"
                   DataService="@DataDetailsMainService" DataDetailService="@DataDetailsService">
                <TableColumns Context="Detail">
                    <TableColumn @bind-Field="@Detail.SortNo" Width="20" />
                    <TableColumn @bind-Field="@Detail.AName" Width="120" />
                    <TableColumn @bind-Field="@Detail.Length" />
                    <TableColumn @bind-Field="@Detail.defaultValue" />
                    <TableColumn @bind-Field="@Detail.ADesc" Width="120" />
                    <TableColumn @bind-Field="@Detail.AType" />
                    <TableColumn @bind-Field="@Detail.IsShow" />
                    <TableColumn @bind-Field="@Detail.IsAutoGenerate" />
                    <TableColumn @bind-Field="@Detail.IsKey" />
                </TableColumns>
            </Table>
        </div>
    </DetailRowTemplate>
</Table>
